"""
chord.client_api

Defines the interface between the Chord server and any application built on top of it.

NOTE: This API is accessed programmatically and has no corresponding views. 
"""
import core

def lookup(key):
    """ API wrapper for core.find_successor
    @author: ep
    @param key: key to find
    @rtype: chord.Server
    """
    # Assert that server is active
    if not core.i_am_active():
        raise Exception("ChordServerNotActiveError")

    return core.find_successor(key)
